<?php

namespace app\index\controller\consulting;

use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;

/**
 * Class ConsultingAd
 * @package app\index\controller\consulting
 */
class ConsultingAd
{

    /**
     * 咨询列表
     * @return ApiResponse
     * @url /consulting/consulting_ad/index
     */
    public function index(): ApiResponse
    {
        $cities = ['北京', '天津', '上海', '重庆', '河北', '山西', '辽宁', '吉林', '江苏', '浙江', '安徽',
            '福建', '江西', '山东', '河南', '湖北', '湖南', '广东', '广西', '海南', '四川', '贵州','云南',
            '西藏', '陕西', '甘肃', '青海', '宁夏', '新疆'];

        shuffle($cities);

        $path = '/storage/defaultavatar/';

        $data = [
            ['headImg' => image_url($path . mt_rand(1, 22) . '.jpg'), 'str1' => array_shift($cities) . '用户支付了', 'str2' => '68元', 'str3' => '咨询了在线律师',],
            ['headImg' => image_url($path . mt_rand(1, 22) . '.jpg'), 'str1' => array_shift($cities) . '用户给了在线律师一个', 'str2' => '五星好评', 'str3' => '',],
            ['headImg' => image_url($path . mt_rand(1, 22) . '.jpg'), 'str1' => array_shift($cities) . '用户咨询律师挽回了', 'str2' => '5600元', 'str3' => '损失',],
            ['headImg' => image_url($path . mt_rand(1, 22) . '.jpg'), 'str1' => array_shift($cities) . '用户支付成功', 'str2' => '34秒', 'str3' => '后收到了解答',],
            ['headImg' => image_url($path . mt_rand(1, 22) . '.jpg'), 'str1' => array_shift($cities) . '用户使用服务后与律师及时沟通', 'str2' => '', 'str3' => '',],
        ];

        return ApiResponse::success($data);
    }


}
